<?php

use Illuminate\Database\Seeder;

class CompaniesTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $c = DB::table('companies')->find(1);
        if (!$c) {
            DB::table('companies')->insert([
                'name' => '广西北港新材料有限公司',
                'code' => 'BGM',
                'address' => '广西北海市铁山港区工业园区四号路与七号路交汇处',
            ]);
        }
        DB::table('staff')->update(['company_id' => 1]);
        DB::table('departments')->update(['company_id' => 1]);
        DB::table('dorms')->update(['company_id' => 1]);
        DB::table('buildings')->update(['company_id' => 1]);
        DB::table('users')->update(['company_id' => 1]);
    }
}
